import controller from '../controller'

cc.Class({
	extends: controller,

	properties: {

	},

	onLoad () {
		controller.prototype.onLoad.call(this)
		this.view['backGround/crateRoleBtn'].on('click', function (){this.view.crateRole.active = true}, this)
		this.view['crateRole/backBtn'].on('click', function (){this.view.crateRole.active = false}, this)
		this.view['backGround/enterBtn'].on('click', this.enterGame, this)
		let leftRoleAnimation = this.view['backGround/roleAnimationLeft'].getComponent(cc.Animation)
		let rightRoleAnimation = this.view['backGround/roleAnimationRight'].getComponent(cc.Animation)
		leftRoleAnimation.play()
	},

	start () {

	},
	// update (dt) {},
	enterGame () {
		cc.director.loadScene('gameScene')
	}
});
